﻿<MVVMBase:UserControlBase x:Class="EzDesk.DesktopClient.AppModule.View.MoreFunctionPanelView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:MVVMBase="clr-namespace:EzDesk.MVVMBase;assembly=EzDesk.MVVMBase" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" 
             MaxHeight="220">
    <MVVMBase:UserControlBase.Resources>
        <Style x:Key="GreenText"  TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
            <Setter Property="Foreground" Value="{StaticResource FontGreen}">
            </Setter>
        </Style>
    </MVVMBase:UserControlBase.Resources>

    <TabControl x:Name="MoreFunctions" Grid.Row="0" BorderBrush="{StaticResource FontGreen}"  ItemsSource="{Binding FunctionTypeViewModelCollection}">
        <TabControl.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Path=FunctionTypeModel.DisplayText}"></TextBlock>
            </DataTemplate>
        </TabControl.ItemTemplate>
        <TabControl.ContentTemplate>
            <DataTemplate>
                <ScrollViewer HorizontalScrollBarVisibility="Auto"  HorizontalAlignment="Stretch"  VerticalScrollBarVisibility="Hidden">
                    <ItemsControl ItemsSource="{Binding AppFunctionCategoryViewModelCollection}">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Horizontal"></StackPanel>
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <DockPanel Width="115">
                                    <TextBlock Style="{StaticResource GreenText}"  Margin="5,1,1,1"  Text="{Binding Path=FunctionCategoryModel.DisplayText}" DockPanel.Dock="Top" FontSize="14">

                                    </TextBlock>
                                    <ItemsControl DockPanel.Dock="Bottom"  ItemsSource="{Binding AppFunctionViewModelCollection}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <Button  TextElement.Foreground="{StaticResource FontGreen}"  HorizontalAlignment="Stretch"  HorizontalContentAlignment="Stretch" ToolTip="{Binding Path=AppFunctionModel.Description}" Command="{Binding CallAppFunctionCommand}">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Width="25" Source="{Binding Path=AppFunctionModel.IconUrl,Converter={StaticResource ImageCacherConverter}}"></Image>
                                                        <TextBlock Margin="5,5,0,0" Width="80"  TextWrapping="WrapWithOverflow" Text="{Binding Path=AppFunctionModel.Title}"></TextBlock>
                                                    </StackPanel>
                                                </Button>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                    </ItemsControl>
                                </DockPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>
            </DataTemplate>
        </TabControl.ContentTemplate>
    </TabControl>
</MVVMBase:UserControlBase>
